<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use App\Http\Middleware\Authenticate;
use Illuminate\Support\Facades\Route;
Route::middleware('auth')->group(function() {
    Route::get('/', 'AppController@index')->name('homes'); //主页
});
Route::view('entrance', 'backend.entrance')->name('entrance');
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
Route::get('logout', 'Auth\LoginController@logout')->name('apps.logout'); //退出登录
Route::get('uaclogout', 'Auth\LoginController@uaclogout')->name('apps.uaclogout'); //退出登录
Route::view('relogin', 'apps.relogin')->name('relogin');
Route::match(['get','post'], 'rpc', 'WebServiceController@index')->name('rpc');
Route::post('api', 'OpenApiController@index')->name('api');
Route::post('dec', 'DecController@index')->name('dec');


// 用户认证相关路由（禁用注册、重置密码、邮件验证功能）
Auth::routes(['register' => false, 'reset' => false, 'verify' => false]);
if (env('APP_ENV') == 'local') { //本地开发环境下可访问测试控制器
    Route::namespace('Test')->prefix('test')->name('test.')->group(function () {
//        Route::get('rpc/sso', 'XmlrpcController@sso');
//        Route::get('rpc/index', 'XmlrpcController@index');
//        Route::get('rpc/node', 'XmlrpcController@node');
        Route::match(['get','post'], 'rpc/server', 'XmlrpcController@server');
        Route::get('switch/{user_id}', 'UserController@switchUser')->where('user_id', '[a-zA-Z0-9_]+');
        Route::get('mswitch/{mobile}', 'UserController@mswitchUser')->where('mobile', '[a-zA-Z0-9_]+');
        Route::get('stswitch/{mobile}', 'UserController@stswitchUser')->where('mobile', '[a-zA-Z0-9_]+');
        Route::get('aa', 'UserController@switchUser')->where('user_id', '[a-zA-Z0-9_]+');
    });
}

Route::get('admin/databoard/xuSchool', 'Admin\DataBoard\XuApiController@school');
Route::match(['get', 'post'], 'admin/databoard/xuGetData', 'Admin\DataBoard\XuApiController@xuGetData');//大屏数据获取
Route::match(['get', 'post'], 'admin/databoard/getData', 'Admin\DataBoard\IndexController@getData');//大屏数据获取
Route::view('admin/databoard/daping', 'databoard.daping')->name('admin.databoard.daping');//长宁路小学智慧体育管理平台班级数据看板



